<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    var city1 = [
        {"name": "南宁市1", "value": [108.36637, 22.817746]},
      {"name": "南宁市2", "value": [108.36637, 22.817746]},
      {"name": "南宁市3", "value": [108.36637, 22.817746]},
      {"name": "南宁市4", "value": [108.36637, 22.817746]},
      {"name": "南宁市5", "value": [108.36637, 22.817746]},
      {"name": "南宁市6", "value": [108.36637, 22.817746]},
    ]
    var city2 = [
      {"name": "南宁市7", "value": [108.36637, 22.817746]},
      {"name": "南宁市8", "value": [108.36637, 22.817746]},
      {"name": "南宁市9", "value": [108.36637, 22.817746]},
      {"name": "南宁市10", "value": [108.36637, 22.817746]},
      {"name": "南宁市11", "value": [108.36637, 22.817746]},
      {"name": "南宁市12", "value": [108.36637, 22.817746]},
    ]

    var city3 = [
      {"name": "南宁市13", "value": [108.36637, 22.817746]},
      {"name": "南宁市14", "value": [108.36637, 22.817746]},
      {"name": "南宁市15", "value": [108.36637, 22.817746]},
      {"name": "南宁市16", "value": [108.36637, 22.817746]},
      {"name": "南宁市17", "value": [108.36637, 22.817746]},
      {"name": "南宁市18", "value": [108.36637, 22.817746]},
    ]
    var city = [city1, city2, city3]

    let result = null
    let params = '南宁市11'

    city.forEach(c => {
      setTimeout(()=> {
        search(params, c)
        console.log(result)
      })
    })



    function search(cityName, citys) {
      citys.forEach(v => {
        if (result) {
          return
        }
        if (v.name === cityName) {
          result = v
        }
      })
    }


</script>
</html>
